#include "Bank.h"

Bank::Bank( unsigned int numStudents ) : 
myNumStudents(numStudents)
{
    myBalance.resize(numStudents);
    // initial balance is 0
    for(unsigned int i = 0; i < numStudents; i++)
    {
        myBalance.at(i) = 0;    
    }
}

void Bank::deposit( unsigned int id, unsigned int amount )
{
    myBalance.at(id) += amount;
}

void Bank::withdraw( unsigned int id, unsigned int amount )
{
    while(myBalance.at(id)<amount)  _Accept(deposit);
}
